Fix multiple SVG import rendering bugs in masks and gradient strokes.#3503
Open
OnionsYu wants to merge 4 commits into
Open
Fix multiple SVG import rendering bugs in masks and gradient strokes.#3503OnionsYu wants to merge 4 commits into
OnionsYu wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3503 +/- ##
==========================================
- Coverage 80.57% 80.55% -0.03%
==========================================
Files 620 620
Lines 67021 67024 +3
Branches 19885 19887 +2
==========================================
- Hits 54002 53988 -14
- Misses 9083 9086 +3
- Partials 3936 3950 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
本次修复了 SVG 导入过程中三处影响渲染正确性的问题:
mask-type 属性未生效:之前固定使用 Luminance 计算遮罩,忽略了 SVG 标准的 mask-type 属性。现在会读取 mask-type,"alpha" 时使用 MaskType::Alpha,其余情况保持 Luminance 默认行为。
渐变描边 stroke-opacity 失效:原实现仅在纯色分支处理 stroke-opacity,导致 url() 引用的渐变描边丢失透明度。已将 stroke-opacity 解析提前到分支之前,使其同时作用于纯色和渐变描边。
隐藏 mask 引用图层与可见图层被合并:isSimpleShapeLayer 在合并简单形状图层时未区分可见性,会把不可见的 mask 引用层与同形状的可见图层合并,导致可见图层的 painter 丢失、画面消失。现在显式拒绝合并不可见图层。